# -*- coding:utf-8 -*- 
__date__ = '2021/12/26 3:54 下午'

from util.list_util import random_list


def shell_sort(collection):
    length = len(collection)
    # 以一定的间隔排序
    grep = 4
    mid = length//2
    for i in range(0, mid):
        print(collection[i], '-----', collection[i+mid])
        if collection[i] > collection[i + mid]:
            collection[i], collection[i + mid] = collection[i + mid], collection[i]
            print(collection)


if __name__ == '__main__':
    # random_list = random_list()
    for i in range(10):
        print("{0:^3} ".format(i), end=',')
    random_list = [-90, 67, 13, -18, -46, -86, 95, -15, 4, -53]
                                       # *

    print('\n', random_list)
    shell_sort(random_list)
